package at.sysarch.bean;

import at.pimpmypipe.interfaces.Readable;
import at.sysarch.domain.TransferImage;
import at.sysarch.filter.ThresholdFilter;
import at.sysarch.utils.LinkEvent;
import at.sysarch.utils.LinkListener;

public class Threshold extends AbstractBean<ThresholdFilter> implements
		LinkListener {

	private static final long serialVersionUID = 1L;

	public Threshold() {
		_filter = new ThresholdFilter(this);
	}

	@Override
	public void linkBean(LinkEvent event) {
		_filter.setInput(event.getInput());
		event.getInput().setOutput(_filter);
		_filter.run();
	}

	@Override
	public void addLinkListener(LinkListener listener) {
		listener.linkBean(new LinkEvent((Readable<TransferImage>) _filter));
	}

	@Override
	public void removeLinkListener(LinkListener listener) {

	}
	
	public int getLowThreshold() {
		return _filter.getLowThreshold();
	}

	public void setLowThreshold(int lowThreshold) {
		_filter.setLowThreshold(lowThreshold);
	}

	public int getHighThreshold() {
		return _filter.getHighThreshold();
	}

	public void setHighThreshold(int highThreshold) {
		_filter.setHighThreshold(highThreshold);
	}

	public int getMapThreshold() {
		return _filter.getMapThreshold();
	}

	public void setMapThreshold(int mapThreshold) {
		_filter.setMapThreshold(mapThreshold);
	}
}
